home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group99a.txt
/
000170_icon-group-sender _Fri Jul 30 07:26:11 1999.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
3KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id HAA04723
for icon-group-addresses; Fri, 30 Jul 1999 07:25:27 -0700 (MST)
Message-Id: <199907301425.HAA04723@baskerville.CS.Arizona.EDU>
From: gep2@terabites.com
Date: Thu, 29 Jul 1999 18:48:11 -0500
Subject: How to Bring Back the Old basename
To: icon-group@optima.CS.Arizona.EDU
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
> Nevin Liber has a good point regarding basename. Even if the latest version
is closer to the original intentions, as well as the closer to what the name
suggests, there may be many applications dependant on the old behavior.
I'm going to make several observations here.
> To keep these applications from breaking, we need to retain the old, quirky
behavior. This is unfortunate for new developers who would rather have
something closer to the Unix utility.
Personally, I have no vested interest (or other interest, for that matter) in
making ANYTHING work like some Unix version does... I consider Unix in general
to be an anachronistic relic, with crappy documentation standards and inherently
anarchistic ongoing development efforts. And I also don't consider it
particularly compelling to argue that any given name (especially something as
generic as "basename") has any kind of copyright on the name, giving them the
right to define what said named function does (or doesn't do) forever and ever
amen.
And that's especially true when the function's behavior can be argued to be
"broken" in the way an old, stupid, anachronistic implementation did things.
> Has anyone else noticed how superfluous the second parameter to the old
basename is? The old basename chops off the extension whether or not the
second parameter is specified, and whether or not it is present, so when
does specifying an extension make a difference?
> The best option for now may be to fix basename to return the old behavior,
and also update the documentation to clarify the quirk. Here is my proposal:
I think my recommendation would be to specify in the documentation and/or
routine comments that this routine has a number of quirks and odd behavior, and
give some specific examples showing cases that might yield unexpected results.
It would be perfectly reasonable to compare (in the comments) how the
old-fashioned Unix-y "basename", the "old Icon" basename, and the "new Icon"
basename would behave in the same situations.
Yet another approach might be to add a third "mode" parameter, which could be
set to different values specifying which type of behavior one wanted from the
routine.
To eliminate unwanted "default" behavior, one might purposely "break" old
programs by requiring that the third mode parameter be explicitly provided...
this would attract attention to the comments in the revised routine and force
the programmer to decide (and specify) which behavior he (or she) wants.
Gordon Peterson
http://web2.airmail.net/gep2/
Support the Anti-SPAM Amendment! Join at http://www.cauce.org/
12/19/98: the day the Conservatives demonstrated their scorn for their
fraudulent sham of representative government. Voters, remember it!